﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace project.B12.application.Extensions
{
    public class MyMultiProjectValueConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Count() == 0)
                return null;
            if (values[1].ToString() == string.Empty)
                return values[0].ToString();
            string result=values[0].ToString()+ "," + values[1].ToString();
            return result; // 或者你可以抛出一个异常
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
